Page({
  onLoad() {
    this.setData({
      theme: wx.getSystemInfoSync().theme || 'light'
    })

    if (wx.onThemeChange) {
      wx.onThemeChange(({
        theme
      }) => {
        this.setData({
          theme
        })
      })
    }
  },
  data: {
    theme: 'light',
    schema: [{
      prop: 'src',
      label: '图片地址',
      type: 'text'
    }, {
      prop:'mode',
      label:'图片裁剪、缩放的模式',
      type:'picker',
      labelOptions:['scaleToFill','aspectFit','aspectFill','widthFix','heightFix','top','bottom','center','left','right','top left','top right','bottom left','bottom right'],
      valueOptions:['scaleToFill','aspectFit','aspectFill','widthFix','heightFix','top','bottom','center','left','right','top left','top right','bottom left','bottom right']
    },{
      prop:'showMenuByLongpress',
      label:'长按菜单',
      type:'switch'
    }],
    title:'image',
    formData:{
      src:'https://img0.baidu.com/it/u=4146947590,1577640986&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1731',
      mode:'widthFix',
      showMenuByLongpress:true
    },
    result:''
  },
  getFormData(e){
    console.log(e)
    this.setData({
      formData:e.detail.formData
    })
  }
})